package me.lensfrex.vegetables.resopnse;

public enum ResultStatus {
    SUCCESS(200, "成功！"),

    EMPTY_DATA(0, "数据是空的"),
    PAGE_OUT_OF_RANGE(100, "请求的页码超过最大值"),
    PAGE_PARAM_WORN(101, "分页参数有误"),
    SOURCE_DATA_WORN(404, "源数据有错误，分页读取失败"),
    UNKNOWN_ERROR(503, "未知错误");

    /**
     * 返回码。其值为ResultCode中定义的常量
     */
    private final int code;

    /**
     * 返回的结果信息
     */
    private final String message;

    ResultStatus(int code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public String toString() {
        return "code: " + code + ", " +
                "msg: '" + message + '\'';
    }
}
